package com.example.springboot.controller.impl;

import com.example.springboot.controller.addController;
import com.example.springboot.service.impl.addServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class addControllerImpl implements addController {
    //注入业务逻辑层
    @Autowired  //表示把业务逻辑层注入到控制层
    addServiceImpl myAddServiceImpl;
    @GetMapping("/addInfo")
    @Override
    public String addControllerDate() {
        String result = myAddServiceImpl.addServiceData("用户要添加数据");
        //控制层调用业务逻辑层
        return result;
    }
}
